package com.excilys.capicsoubank.constraints;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import com.excilys.capicsoubank.validators.AccountIsValidValidator;

/**
 * Vérifie si l'ID correspond à un compte valide.
 * 
 * @author "Grégory Coutant"
 * 
 */
@Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = AccountIsValidValidator.class)
@Documented
public @interface AccountIsValid {

	String message() default "Compte invalide";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

}
